<?php

class LogoutController extends BaseController {
        
    public function indexAction($requestData) {
		$arg0 = isset($requestData['arg0']) ? $requestData['arg0'] : "";
		if($arg0 == 'user') {
			if(isset($_SESSION['pk_user'])) {
				unset($_SESSION['pk_user']);		
				BaseController::redirect("../ranking/");
				return;
			}
		}
    
		if($arg0 == 'guest') {
			if(isset($_SESSION['email'])) {
				unset($_SESSION['email']);				
				BaseController::redirect("../my_event/");
				return;
			}
		}
    
		if($arg0 == 'admin') {
			if(isset($_SESSION['p1_admin'])) {
				unset($_SESSION['p1_admin']);				
				BaseController::redirect("../admin/");
				return;
			}
		}
		
		BaseController::redirect("../");
    }

}

?>